<?
	$results = array();
	require_once('../inc/Users.php');
	if(isset($_POST['id']))
	{
		$results = DeleteUser($_POST['id']);
		if($results === true)
		{
			header("Location: index.php?deleted=$_POST[id]");
			die();
		}
	}else{
		$row = GetUser($_REQUEST['id']);
	}
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Details of user: <?=$row['FirstName']?> <?=$row['LastName']?></title>
    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css">
    <link rel="stylesheet" type="text/css" href="../inc/bootstrap.css">
    <style type="text/css" >
    	.error { color: red; }
		input.error { border-color: red; }
    </style>
</head>

<body>
        <? include('../inc/header.php'); ?>
        <div class="container">
			<? include('../inc/nav.php'); ?>
            <div id="contents">
            	
            	<dl class="error">
            		<? foreach ($results as $key => $value): ?>
						<dt><?=$key?></dt>
						<dd><?=$value?></dd>
					<? endforeach; ?>
            	</dl>
            	
                <form class="form-horizontal" method="post" action="delete.php">
                	<h2>Delete User</h2>
                    <h3>Are you sure you want to delete <?=$row['FirstName']?> <?=$row['LastName']?> ?</h3>
                	<input type="hidden" name="id" value="<?=$row['id']?>" />
                    <div class="modal-footer">
                    <input class="btn btn-primary" type="submit" value="Yes" />
                    </div>
                </form>
           </div>
       </div>
</body>
</html>






